if has("multi_byte") && has("Gui")
    set rop=type:directx,gamma:1.0,contrast:0.5,level:1,geom:1,renmode:4,taamode:1
    source $VIMRUNTIME/delmenu.vim 
    source $VIMRUNTIME/menu.vim 
    language messages zh_CN.utf-8 
endif 

" add node.js path to environment
" let $PATH.=";D:/Software/Study/node;D:/Software/Study/nodejs/node_global_modules"

" set pythonthreedll=$VIM/vimfiles/win32exe/python/python36.dll

let s:ctags_path = "ctags.exe"
let s:gtags_path = "gtags.exe"
let s:gtags_cscope_path = "gtags-cscope.exe"

" 文件切换
" Yggdroot/LeaderF
"   let g:Lf_UseCache = 1
"   let g:Lf_CacheDirectory = $TEMP."/cache"

" 自动索引
" ludovicchabant/vim-gutentags
    let g:gutentags_ctags_executable = s:ctags_path
    let g:gutentags_gtags_executable = s:gtags_path
    let g:gutentags_gtags_cscope_executable = s:gtags_cscope_path

    let g:gutentags_modules = []
    if executable(s:ctags_path)
        let g:gutentags_modules += ['ctags']
    endif
    if executable(s:gtags_path) && executable(s:gtags_cscope_path)
        let g:gutentags_modules += ['gtags_cscope']
    endif

    " 将自动生成的 tags 文件全部放入 $TEMP/.cache/tags 目录中，避免污染工程目录
    let s:vim_tags = expand($TEMP.'/.cache/tags')
    let g:gutentags_cache_dir = s:vim_tags

    " 检测 $TEMP/.cache/tags 不存在就新建
    if !isdirectory(s:vim_tags)
       silent! call mkdir(s:vim_tags, 'p')
    endif
    let g:gutentags_ctags_extra_args += ['--output-format=e-ctags']

" 编译运行
" skywind3000/asyncrun.vim
" skywind3000/vim-quickui
    " 编译单个文件
    let s:gcc_path = 'gcc.exe'
    let s:gpp_path = 'g++.exe'
    call quickui#menu#install('&compile and run', [
            \ [ "single &c file", 'AsyncRun '.s:gcc_path.' -g "$(VIM_FILEPATH)" -o "$(VIM_PATHNOEXT).exe"', '编译c单个文件' ],
            \ ], '<auto>', 'c')
    call quickui#menu#install('&compile and run', [
            \ [ "single c&pp file", 'AsyncRun '.s:gpp_path.' -g "$(VIM_FILEPATH)" -o "$(VIM_PATHNOEXT).exe"', '编译c++单个文件' ],
            \ ], '<auto>', 'cpp')
    call quickui#menu#install('&compile and run', [
            \ [ "--", '' ],
            \ [ "&run file", 'AsyncRun "$(VIM_PATHNOEXT).exe"', '运行文件' ],
            \ ], '<auto>', 'c,cpp')

if !exists("my_auto_commands_loaded_1")
    " make
    if has('autocmd')
        autocmd BufReadPost *.c setlocal makeprg=gcc\ -o\ %<\ %\ -std=c11
        autocmd BufReadPost *.cpp setlocal makeprg=g++\ -o\ %<\ %\ -std=c++1z
        autocmd BufReadPost *.cxx setlocal makeprg=g++\ -o\ %<\ %\ -std=c++1z

        function! QfMakeConv()
            let qflist = getqflist()
            for i in qflist
                let i.text = iconv(i.text, "cp936", "utf-8")
            endfor
            call setqflist(qflist)
        endfunction

        autocmd QuickFixCmdPost make call QfMakeConv()
    endif
endif

" everything
" voldikss/vim-find-everything
    let g:fe_window_type = 'popup'
